import { TAddress } from "@/store/TravelRecordLibraryStore"
import { TLumpSumCarFare } from "../LumpSumCarFareManagement/LumpSumCarFareManagement"

export type TTravelInfo = typeof AddTravelRecordClass.prototype.travelInfo

export interface TravelPerson {
	name: string // 人名
	myTravelExpenses: number // 个人差旅费
	mealsSelected: number[] // 已选的用餐
}

export const haveMeals = [
	{ id: 1, label: "早", discount: 0.2 },
	{ id: 2, label: "中", discount: 0.4 },
	{ id: 3, label: "晚", discount: 0.4 },
]

export default class AddTravelRecordClass {
	showCalendar = false
	showAddressPopup = false
	cascaderValue = ""
	showActionSheet = false
	showHandledBySheet = false
	showCarFarePopup = false
	lumpSumCarFare = ""
	customizeAmount = 0

	peopleHaveMeals = []

	peopleLibrary = [] as string[]
	addressLibrary = [] as TAddress[]
	lumpSumCarFareLibrary = [] as TLumpSumCarFare[]

	/**
	 * 主数据结构
	 * 出差记录数据结构
	 */
	travelInfo = {
		// 编号
		id: "",
		// 出差日期
		travelDate: "",
		// 出差地址
		travelAddress: "",
		// 出差人员
		travelPeople: [] as TravelPerson[],
		// 是否派车
		officialCars: true,
		// 出差事由
		travelReason: "",
		// 是否核销
		isReimbursed: 0,
		// 出差费用
		travelExpenses: 0,
		// 经办人员
		handledBy: "",
		// 备注
		notes: "",
		// 创建日期时间
		createDate: "",
	}
}
